'use strict';
// Copyright 2014 Blueant Inc. All Rights Reserved.

/**
 * @fileoverview 材料
 * @author sundbcn@gmail.com (sun debing)
 */

var dataApi = require('../libs/dataApi');

exports.getPropertyTypeConf = function (property_type) {
    return _getPropertyTypeConf(property_type);
};

/**
 * 获取材料的出售价格
 * @param  {[type]} equip_type [description]
 * @param  {[type]} lv         [description]
 * @return {[type]}            [description]
 */
exports.getPropertySellGold = function (property_type) {
    var property_conf = _getPropertyTypeConf(property_type);
    if (!property_conf) {
        console.error('property_conf type can not found:' + property_conf);
        return 0;
    }
    return property_conf.gold_worth;
};

/**
 * 获取道具配置
 * @param  {[type]} property_type [description]
 * @return {[type]}               [description]
 */
var _getPropertyTypeConf = function (property_type) {
    var property_conf = dataApi.property.findById(property_type);
    if (!property_conf) {
        console.error('property type can not found:' + property_type);
        return;
    }
    return property_conf;
};
